#pragma once
#include<stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef int DataType;

typedef struct Heap {
	DataType* a;
	int size;
	int capacity;
}HP;

void HeapInit(HP* hpop);
void HeapDestory(HP* hpop);
void HeapPrint(HP* hpop);
void HeapPush(HP* hpop, DataType x);
void AdjustUp(DataType* a, int child);
void exchange(DataType* child,DataType* parent);
void HeapPop(HP* hpop);
void AdjustDown(DataType* a, int parent,int size);
int IsEmpty(HP* hpop);
int HeapTop(HP* hpop);
void HeapSort(DataType* a,int size);
void HeapInitArray(HP* hpop, DataType* a, int size);
int HeapSize(HP* hpop);